package com.mpspboot.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;

import java.io.Serializable;
import java.util.Date;

import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * <p>
 *
 * </p>
 *
 * @author guocb
 * @since 2021-02-20
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("smbms_user")
public class User implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 用户编码
     */
    private String userCode;

    /**
     * 用户名称
     */
    private String userName;

    /**
     * 用户密码
     */
    private String userPassword;

    /**
     * 性别（1:女、 2:男）
     */
    private Integer gender;

    /**
     * 出生日期
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd") //日期转换
    private Date birthday;

    /**
     * 手机
     */
    private String phone;

    /**
     * 地址
     */
    private String address;

    /**
     * 用户角色（取自角色表-角色id）
     */
    private Long userRole;

    /**
     * 创建者（userId）
     */
    private Long createdBy;

    /**
     * 创建时间
     */
    private Date creationDate;

    /**
     * 更新者（userId）
     */
    private Long modifyBy;

    /**
     * 更新时间
     */
    private Date modifyDate;

    private String idPicPath;

    private int isDeleted;

    //角色名  逻辑字段
    @TableField(exist = false)
    private String roleName;

    public static final String ISDELETED = "isDeleted";

    public static final String ID = "id";

    public static final String USERCODE = "userCode";

    public static final String USERNAME = "userName";

    public static final String USERPASSWORD = "userPassword";

    public static final String GENDER = "gender";

    public static final String BIRTHDAY = "birthday";

    public static final String PHONE = "phone";

    public static final String ADDRESS = "address";

    public static final String USERROLE = "userRole";

    public static final String CREATEDBY = "createdBy";

    public static final String CREATIONDATE = "creationDate";

    public static final String MODIFYBY = "modifyBy";

    public static final String MODIFYDATE = "modifyDate";

    public static final String IDPICPATH = "idPicPath";

}
